'use strict';
/*
 * 运营管理——分组管理
 * @type {*}
 */
let underscore = require('underscore');
let RestifyProxy = require('../../util/RestifyProxy');
let StringUtil = require('../../util/StringUtil');
let Constant = require('../../model/Constant');
let baseService = require('../BaseService');
const URI = {
    GROUPS: '/operate/operategroup/list',//列表
    CREATE: '/operate/operategroup/insert',//新增保存按钮
    DETAIL: '/operate/operategroup/query/{0}',//详情
    DETAIL_LIST: '/operate/light/list',//详情的单灯列表
    UPDATE: '/operate/operategroup/update',//修改确认按钮
    DELETE: '/operate/operategroup/delete/{0}',//删除按钮
    
    GROUPS_SELECT: '/operate/operategroup/query',//转移分组——下拉框
    GROUPS_UPDATE: '',//修改转移分组
    
    PLAN_LIST: '',//照明计划数据
    PLAN_UPDATE: '',//修改照明计划
    PLAN_SAVE: ''//保存照明计划
};

/*分组管理-列表数据*/
module.exports.groupsList = function (thiz, params) {
    return baseService.get(thiz, URI.GROUPS, params);
};
/*分组管理-新增分组*/
module.exports.groupsCreateSave = function (thiz, params) {
    return baseService.post(thiz, URI.CREATE, params);
};
/*分组管理-详情*/
module.exports.groupsDetail = function (thiz, params) {
    return baseService.get(thiz, StringUtil.format(URI.DETAIL, params));
};
/*分组管理-详情页面-获取详情单灯列表*/
module.exports.groupsDetailList = function (thiz, params) {
    return baseService.get(thiz, URI.DETAIL_LIST, params);
};

/*分组管理-详情页面-获取照明计划数据*/
module.exports.groupsPlanList = function (thiz, userId) {
    return baseService.get(thiz, StringUtil.format(URI.PLAN_LIST, userId));
};

/*分组管理-修改分组*/
module.exports.groupsUpdateSave = function (thiz, userId) {
    return baseService.post(thiz, URI.UPDATE, userId);
};
/*分组管理-修改页面-转移分组下拉框*/
module.exports.groupsUpdateList = function (thiz, userId) {
    return baseService.get(thiz, StringUtil.format(URI.GROUPS_SELECT, userId));
};

/*分组管理-修改页面-转移分组按钮*/
module.exports.groupsUpdateConfirm = function (thiz, params) {
    return baseService.put(thiz, StringUtil.format(URI.GROUPS_UPDATE, params.userId), params);
};

/*分组管理-修改页面-照明计划的修改确认按钮*/
module.exports.groupsUpdateConfirm = function (thiz, params) {
    return baseService.put(thiz, StringUtil.format(URI.PLAN_UPDATE, params.userId), params);
};
/*分组管理-修改页面-照明计划的保存按钮*/
module.exports.groupsUpdateConfirm = function (thiz, params) {
    return baseService.put(thiz, StringUtil.format(URI.PLAN_SAVE, params.userId), params);
};

/*分组管理-删除按钮*/
module.exports.groupsDelete = function (thiz, params) {
    return baseService.del(thiz, StringUtil.format(URI.DELETE, params));
};